import java.util
import java.util.Date
import java.util.concurrent.ConcurrentHashMap

import akka.actor.ActorRef
import org.apache.commons.lang3.StringUtils

/**
  * Created by liuwei on 2017/12/9.
  */
object ListTest {

  def main(args: Array[String]): Unit = {
//    val list = List("5555","66666")
    import scala.collection.JavaConversions._
//    val userIds = StringUtils.join(list.t, "~");
//    println(list.mkString("~"))
//    println(list.take(5))
    val list2:Option[String] =Some("")
    println(list2)
    println(list2.isDefined)
    println(list2.isEmpty)

    println(new Date(1513602030720L))
    println(new Date(1513603533970L))
//    println(new Date(1513335601577L))
//    println(new Date(1513602003376L))
    val weights = Array(0.4,0.6)
    val sum = weights.sum
    println(sum)
    val normalizedCumWeights = weights.map(_ / sum).scanLeft(0.0d)(_ + _).sliding(2)
    println(normalizedCumWeights)


    val list555 = new util.ArrayList[String]()
    list555.add("777777")
    var actorsMap:util.Map[String, util.List[String]] = new ConcurrentHashMap

    actorsMap.put("1",list555)

    var list = actorsMap.get("1")
    list.add("555555555555555555")

    println(actorsMap.get("1"))



    for (actor <- list) {

      println(actor)
    }



  }

}
